<include href="base/header.html"/>
<div class="messages">
    <check if="{{ @dbparams_saved }}">
        <true>
            <p>Settings are saved.</p>
        </true>
    </check>
</div>
<div class="form">
    <fieldset>
    <legend>Database Parameters</legend>
    <form action="" method="post">
        <table>
            <thead>
                <tr>
                    <th>Parameter: </th>
                    <th>Value: </th>
                </tr>
            </thead>
            <tbody>
            <tr>
                <td><label for="dbname">Database Name: </label></td>
                <td><input type="text" id="dbname" name="dbname" value="{{ @SETTINGS->database->dbname }}" /></td>
            </tr>
            <tr>
                <td><label for="user">Database User: </label></td>
                <td><input type="text" id="user" name="user" value="{{ @SETTINGS->database->user }}" /></td>
            </tr>
            <tr>
                <td><label for="password">Password: </label></td>
                <td><input type="password" id="password" name="password" value="{{ @SETTINGS->database->password }}" /></td>
            </tr>
            <tr>
                <td><label for="host">Host: </label></td>
                <td><input type="text" id="host" name="host" value="{{ @SETTINGS->database->host }}" /></td>
            </tr>
            <tr>
                <td><label for="port">Port: </label></td>
                <td><input type="text" id="port" name="port" value="{{ @SETTINGS->database->port }}" /></td>
            </tr>
            </tbody>
        </table>
        <button type="submit">Submit</button>
    </form>
    </fieldset>
</div>
<div id="form">
    <fieldset>
    <legend>Table names</legend>
    <form action="/rename_tables" method="post">
        <table>
            <thead>
                <tr>
                    <th>Table name Key</th>
                    <th>Name</th>
                </tr>
            </thead>
            <tbody>
            <repeat group="{{ @SETTINGS->table_names }}" key="{{ @table_name_key }}" value="{{ @table_name }}">
                <tr>
                    <td><label for="{{ @table_name_key }}">{{ @table_name_key }}:</label></td>
                    <td><input type="text" id="{{ @table_name_key }}" name="{{ @table_name_key }}"
                               value="{{ @table_name }}" /></td>
                </tr>
            </repeat>
            </tbody>
        </table>
        <button type="submit">Rename</button>
    </form>
    </fieldset>
</div>

<include href="base/footer.html"/>